package com.java;

import com.lmax.disruptor.EventTranslator;

import java.util.Random;

/**
 * k
 *
 * @author wwm
 * @create 2017-04-17 11:36
 **/
public class TradeTransactionEventTranslator implements EventTranslator<TradeTransaction> {
    private Random random=new Random();
    public void translateTo(TradeTransaction event, long sequence) {
        this.generateTradeTransaction(event);
    }
    private TradeTransaction generateTradeTransaction(TradeTransaction trade){
        trade.setPrice(random.nextDouble()*9999);
        return trade;
    }
}